<?php

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateKdQuestionOptionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kd_question_options', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('question_id')->index()->comment('题目id');
            $table->tinyInteger('is_answer')->default(2)->comment('1是答案,2不是答案');
            $table->string('option', 2000)->comment('题目选项内容');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE kd_question_options COMMENT='题目选项表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kd_question_options');
    }
}
